const DB = require('../db')
const addToken = require('../../token/addToken')
const loginInfor = (app) =>{
    return async (ctx, next) => {
       
            let token = addToken({user:'1234',id:123})
            ctx.cookies.set('token',token,{
                httpOnly: false, // 是否只用于http请求中获取
                overwrite: true // 是否允许重写
            })
            ctx.response.body = {
               infor:'ok',
               setToken:token ? true : false
            }
       
    }
}
module.exports =  loginInfor